package club.kingyin.easycache.utils;

public class Commons {

    // 通过一个系数因子生成随机大小 例如系数0.7 目标值10 则生成[10*0.7,10]之间的随机数
    public static long randomMinToTargetByCoefficient(long target,double coefficient) {
        long min = (long) Math.floor(target * coefficient);
        return ((long) (Math.random() * (target - min + 1) + min));
    }
}
